// /**
//  *	@define:hjc -> 组件 -> 输入框
//  */

// namespace hjc {

// 	export class Input extends hjc.BaseComponent {

// 		/** UI */
// 		private $edtTxt: eui.EditableText;    //可编辑文本
// 		private $focusSrc: string;			//焦点背景图
// 		/** Logic */
// 		private $isFocused: boolean = false; //是否被聚焦
// 		private $enterFunc: Function;        //回车事件

// 		constructor() {
// 			super();
// 			this.$edtTxt = ui.newEdtText();
// 			ui.setCenter(ui.setPadding(this.$edtTxt, { hor: 6, ver: -3 }), this);
// 		}

// 		public get text(): string { return this.$edtTxt.text; }
// 		public set text(text: string) { this.$edtTxt.text = text; }

// 		//设置回车函数
// 		public setEnter(context: any, enterFunc: Function): hjc.Input {
// 			this.$context = context;
// 			this.$enterFunc = enterFunc;
// 			let input = this;
// 			this.$edtTxt.addEventListener(egret.FocusEvent.FOCUS_IN, () => { this.$isFocused = true; this.update() }, this);
// 			this.$edtTxt.addEventListener(egret.FocusEvent.FOCUS_OUT, () => { this.$isFocused = false; this.update() }, this);
// 			game.keyboard().addEventListener(KeyBoard.onkeydown, event => {
// 				if (this.$isFocused && game.keyboard().isContain(event.data, KeyBoard.CnterEnter)) input.triggerEnter();
// 			}, input);
// 			return this;
// 		}

// 		//设置按下背景图
// 		public setBgs(unfocusSrc: string, focusSrc?: string, grids?: hjc.TS9Grids, ps?: string): hjc.Input {
// 			super.setBg(unfocusSrc, grids, ps);
// 			this.$focusSrc = focusSrc;
// 			this.update();
// 			return this;
// 		}

// 		//更新UI
// 		private update(): void {
// 			if (this.$bg) {
// 				if (this.$isFocused && this.$focusSrc) this.$bg.source = this.$focusSrc;
// 				else this.$bg.source = this.$source;
// 			}
// 		}

// 		//键盘事件
// 		public triggerEnter(): void {
// 			if (isEmpty(this.text)) return;
// 			if (this.$context && isFunc(this.$enterFunc)) Reflect.apply(this.$enterFunc, this.$context, [this.text.trim()]);
// 			this.clear();
// 		}

// 		//清除文本
// 		public clear(): hjc.Input {
// 			this.$edtTxt.text = '';
// 			return this;
// 		}

// 		//设置文本长度
// 		public setMaxLength(length: number): hjc.Input {
// 			this.$edtTxt.maxChars = length;
// 			return this;
// 		}

// 		//设置为密码
// 		public setAsPswd(tf: boolean = true): hjc.Input {
// 			this.$edtTxt.inputType = tf ? egret.TextFieldInputType.PASSWORD : egret.TextFieldInputType.TEXT;
// 			return this;
// 		}

// 		//设置为默认外观
// 		public setSize(size: number): hjc.Input {
// 			this.$edtTxt.size = size;
// 			return this;
// 		}

// 		//设置为默认外观
// 		public setDefault(): hjc.Input {
// 			this.setBgs('frm_2', 'frm_1', { x: 10, y: 10, w: 30, h: 20 }).setMaxLength(50);
// 			return this;
// 		}
// 	}
// }